package org.dinqy;

/**
 * @author armandino (at) gmail.com
 */
public enum PredicateType implements JPQLSyntax {
	GreaterThanEquals(" >= ", 1),
	GreaterThan(" > ", 1),
	LessThanEquals(" <= ", 1),
	LessThan(" < ", 1),
	NotEqual(" != ", 1),
	Equal(" = ", 1),
	Like(" like ", 1),
	IsNotNull(" is not null ", 0),
	IsNull(" is null ", 0);
	
	private final String jpql;
	private final int numberOfRequiredArgs;
	
	private PredicateType(String jpql, int numberOfRequiredArgs) {
		this.jpql = jpql;
		this.numberOfRequiredArgs = numberOfRequiredArgs;
	}
	
	@Override
	public String toJPQL() {
	    return jpql;
	}
	
	int getNumberOfRequiredArgs() {
		return numberOfRequiredArgs;
	}
	
}
